using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICDisPlyMap : EntityTypeConfiguration<ICDisPly>
    {
        public ICDisPlyMap()
        {
            // Primary Key
            this.HasKey(t => t.FInterID);

            // Properties
            this.Property(t => t.FNumber)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FPlyType)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.FWeek)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.FMonth)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.FXSTMP)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            this.Property(t => t.FBillNo)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.FCycDesc)
                .IsRequired()
                .HasMaxLength(512);

            // Table & Column Mappings
            this.ToTable("ICDisPly");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FNumber).HasColumnName("FNumber");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FPri).HasColumnName("FPri");
            this.Property(t => t.FPlyType).HasColumnName("FPlyType");
            this.Property(t => t.FSysTypeID).HasColumnName("FSysTypeID");
            this.Property(t => t.FItemTypeID).HasColumnName("FItemTypeID");
            this.Property(t => t.FPeriodType).HasColumnName("FPeriodType");
            this.Property(t => t.FCycBegTime).HasColumnName("FCycBegTime");
            this.Property(t => t.FCycEndTime).HasColumnName("FCycEndTime");
            this.Property(t => t.FWeek).HasColumnName("FWeek");
            this.Property(t => t.FMonth).HasColumnName("FMonth");
            this.Property(t => t.FDayPerMonth).HasColumnName("FDayPerMonth");
            this.Property(t => t.FSerialWeekPerMonth).HasColumnName("FSerialWeekPerMonth");
            this.Property(t => t.FWeekDayPerMonth).HasColumnName("FWeekDayPerMonth");
            this.Property(t => t.FXSTMP).HasColumnName("FXSTMP");
            this.Property(t => t.FClassTypeID).HasColumnName("FClassTypeID");
            this.Property(t => t.FBillNo).HasColumnName("FBillNo");
            this.Property(t => t.FBItem).HasColumnName("FBItem");
            this.Property(t => t.FBCustCls).HasColumnName("FBCustCls");
            this.Property(t => t.FBEmp).HasColumnName("FBEmp");
            this.Property(t => t.FBVIPGrp).HasColumnName("FBVIPGrp");
            this.Property(t => t.FBCust).HasColumnName("FBCust");
            this.Property(t => t.FBItemClass).HasColumnName("FBItemClass");
            this.Property(t => t.FCycDesc).HasColumnName("FCycDesc");
            this.Property(t => t.FBEmpCls).HasColumnName("FBEmpCls");
        }
    }
}
